package com.zhc.dejingapi.utils.qing;
import com.zhc.dejingapi.entity.QingAppfieldsEntity;
import com.zhc.dejingapi.entity.QingAppfieldtablevaluesEntity;
import com.zhc.dejingapi.pojo.qingflow.appfield.QingFieldItemBase;
import com.zhc.dejingapi.pojo.qingflow.appfield.QingFieldItemTableRowValueBase;
import com.zhc.dejingapi.pojo.qingflow.appfield.QingFieldItemValueBase;

public class QingFieldValueUtils {

    public static QingAppfieldsEntity CopyQingAppfieldsFromQingFieldItemBase(QingAppfieldsEntity qingAppfieldsEntity, QingFieldItemBase itemSource)
    {
        QingAppfieldsEntity itemTarget= qingAppfieldsEntity;

        //itemTarget.setFieldId(itemSource.setFieldId());
        //appMain_Id=orgItem.appMain_Id;
        //appKey=orgItem.appKey;
        //associatedQueType=orgItem.associatedQueType;
        itemTarget.setAssociatedQueType(itemSource.getAssociatedQueType());
        //auditValueDescription=orgItem.auditValueDescription;
        itemTarget.setAuditValueDescription(itemSource.getAuditValueDescription());
        //beingCanDecrypted=orgItem.beingCanDecrypted;
        itemTarget.setBeingCanDecrypted(itemSource.getBeingCanDecrypted());
        //beingDesensitized=orgItem.beingDesensitized;
        itemTarget.setBeingDesensitized(itemSource.getBeingDesensitized());
        //dateType=orgItem.dateType;
        itemTarget.setDateType(itemSource.getDateType());
        //queId=orgItem.queId;
        itemTarget.setQueId(itemSource.getQueId());
        //queTitle=orgItem.queTitle;
        itemTarget.setQueTitle(itemSource.getQueTitle());
        //queType=orgItem.queType;
        itemTarget.setQueType(itemSource.getQueType());
        //questionOrdinal=orgItem.questionOrdinal;
        itemTarget.setQuestionOrdinal(itemSource.getQuestionOrdinal());
        //supId=orgItem.supId;
        itemTarget.setSupId(itemSource.getSupId());
        if (itemSource.getValues()==null||itemSource.getValues().isEmpty()){

        }
        else{
            QingFieldItemValueBase valueSource=itemSource.getValues().get(0);
            //value_dataValue=orgItem.value_dataValue;
            itemTarget.setValueDatavalue(valueSource.getDataValue());
            //value_email=orgItem.value_email;
            itemTarget.setValueEmail(valueSource.getEmail());
            //value_id=orgItem.value_id;
            itemTarget.setValueId(valueSource.getId());
            //value_optionId=orgItem.value_optionId;
            itemTarget.setValueOptionid(valueSource.getOptionId());
            //value_ordinal=orgItem.value_ordinal;
            itemTarget.setValueOrdinal(valueSource.getOrdinal());
            //value_otherInfo=orgItem.value_otherInfo;
            itemTarget.setValueOtherinfo(valueSource.getOtherInfo());
            //value_pluginValue=orgItem.value_pluginValue;
            itemTarget.setValuePluginvalue(valueSource.getPluginValue());
            //value_queId=orgItem.value_queId;
            itemTarget.setValueQueid(valueSource.getQueId());
            //value_value=orgItem.value_value;
            itemTarget.setValueValue(valueSource.getValue());
        }

        return itemTarget;
    }

    public static QingAppfieldtablevaluesEntity CopyQingAppTableValueFieldsFromQingFieldItemBase(QingAppfieldtablevaluesEntity qingAppfieldsEntity, QingFieldItemTableRowValueBase itemSource)
    {
        QingAppfieldtablevaluesEntity itemTarget= qingAppfieldsEntity;

        //itemTarget.setFieldId(itemSource.setFieldId());
        //appMain_Id=orgItem.appMain_Id;
        //appKey=orgItem.appKey;
        //associatedQueType=orgItem.associatedQueType;
        itemTarget.setAssociatedQueType(itemSource.getAssociatedQueType());
        //auditValueDescription=orgItem.auditValueDescription;
        itemTarget.setAuditValueDescription(itemSource.getAuditValueDescription());
        //beingCanDecrypted=orgItem.beingCanDecrypted;
        itemTarget.setBeingCanDecrypted(itemSource.getBeingCanDecrypted());
        //beingDesensitized=orgItem.beingDesensitized;
        itemTarget.setBeingDesensitized(itemSource.getBeingDesensitized());
        //dateType=orgItem.dateType;
        itemTarget.setDateType(itemSource.getDateType());
        //queId=orgItem.queId;
        itemTarget.setQueId(itemSource.getQueId());
        //queTitle=orgItem.queTitle;
        itemTarget.setQueTitle(itemSource.getQueTitle());
        //queType=orgItem.queType;
        itemTarget.setQueType(itemSource.getQueType());
        //questionOrdinal=orgItem.questionOrdinal;
        itemTarget.setQuestionOrdinal(itemSource.getQuestionOrdinal());
        //supId=orgItem.supId;
        itemTarget.setSupId(itemSource.getSupId());
        if (itemSource.getValues()==null||itemSource.getValues().isEmpty()){

        }
        else{
            QingFieldItemValueBase valueSource=itemSource.getValues().get(0);
            //value_dataValue=orgItem.value_dataValue;
            itemTarget.setValueDatavalue(valueSource.getDataValue());
            //value_email=orgItem.value_email;
            itemTarget.setValueEmail(valueSource.getEmail());
            //value_id=orgItem.value_id;
            itemTarget.setValueId(valueSource.getId());
            //value_optionId=orgItem.value_optionId;
            itemTarget.setValueOptionid(valueSource.getOptionId());
            //value_ordinal=orgItem.value_ordinal;
            itemTarget.setValueOrdinal(valueSource.getOrdinal());
            //value_otherInfo=orgItem.value_otherInfo;
            itemTarget.setValueOtherinfo(valueSource.getOtherInfo());
            //value_pluginValue=orgItem.value_pluginValue;
            itemTarget.setValuePluginvalue(valueSource.getPluginValue());
            //value_queId=orgItem.value_queId;
            itemTarget.setValueQueid(valueSource.getQueId());
            //value_value=orgItem.value_value;
            itemTarget.setValueValue(valueSource.getValue());
        }

        return itemTarget;
    }
}
